-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kamelets: load kamelets definition at build time #2549
Conversation
@ppalaga @jamesnetherton this is a draft/poc PR to explore the option to load kamelets at build time, so at runtime we have the definition loaded in the form of route templates. As today it is required to create a temporary camel context, but I'm planning to improve the Yaml DSL loader to run without requiring the camel context and to fail only for the operations that are strictly dependent on having the context (none in this specific case). Any suggestion on how to improve this would be really appreciated. Note that the PR can't build at the moment because of quarkusio/quarkus#16954 |
ee1fd55
to
ca8083a
Compare
for (String kamelet : configuration.kamelets.orElse(Collections.emptyList())) { | ||
final String path = KAMELET_LOCATION + "/" + kamelet + ".yaml"; | ||
|
||
try (InputStream is = KameletProcessor.class.getResourceAsStream(path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using TCCL is the safest option to load classes and resources after the split of class loaders in Quarkus 2.0
@ConfigRoot(name = "camel.kamelet", phase = ConfigPhase.BUILD_TIME) | ||
public class KameletConfiguration { | ||
/** | ||
* List of kamelets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we should be more descriptive here. Something like the following (not sure all is correct):
* List of kamelets. | |
* List of resource paths containing Kamelet definitions in YAML format |
I will give this a look next week as per @lburgazzoli suggestion. |
@valdar I think this PR can be closed, correct ? |
Yes |
superseded by #2799 |
No description provided.